gridpack::math::NewtonRaphsonSolverT< T, I > Class Template Reference

Solve a system of nonlinear equations using the Newton-Raphson method in parallel. More...

#include <newton_raphson_solver.hpp>

Inheritance diagram for gridpack::math::NewtonRaphsonSolverT< T, I >:
Inheritance graph
[legend]
Collaboration diagram for gridpack::math::NewtonRaphsonSolverT< T, I >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
NonlinearSolverImplementation
< T, I >::VectorType 
VectorType
typedef
NonlinearSolverImplementation
< T, I >::MatrixType 
MatrixType
typedef
NonlinearSolverImplementation
< T, I >::JacobianBuilder 
JacobianBuilder
typedef
NonlinearSolverImplementation
< T, I >::FunctionBuilder 
FunctionBuilder

Public Member Functions

 NewtonRaphsonSolverT (const parallel::Communicator &comm, const int &local_size, JacobianBuilder form_jacobian, FunctionBuilder form_function)
 Default constructor.
 NewtonRaphsonSolverT (MatrixType &J, JacobianBuilder form_jacobian, FunctionBuilder form_function)
 Construct with an existing Jacobian Matrix.
 ~NewtonRaphsonSolverT (void)
 Destructor.

Detailed Description

template<typename T, typename I = int>
class gridpack::math::NewtonRaphsonSolverT< T, I >

Solve a system of nonlinear equations using the Newton-Raphson method in parallel.

This (fully functional) class is intended as an example of how to implement a nonlinear solver. It has no advantage over the general NonlinearSolver class, which relies on the underlying math library. It is, however, a drop-in replacement for NonlinearSolver.

Users of this class must specify functions or functors that build the Jacobian Matrix and the right hand side Vector. Typically, it's best to use functor classes or structs, since extra required information can be available to the Matrix/Vector construction.

This class is simply an interface to the NewtonRaphsonSolverImplementation class.


Member Typedef Documentation

template<typename T , typename I = int>
typedef NonlinearSolverImplementation<T, I>::FunctionBuilder gridpack::math::NewtonRaphsonSolverT< T, I >::FunctionBuilder
template<typename T , typename I = int>
typedef NonlinearSolverImplementation<T, I>::JacobianBuilder gridpack::math::NewtonRaphsonSolverT< T, I >::JacobianBuilder
template<typename T , typename I = int>
typedef NonlinearSolverImplementation<T, I>::MatrixType gridpack::math::NewtonRaphsonSolverT< T, I >::MatrixType
template<typename T , typename I = int>
typedef NonlinearSolverImplementation<T, I>::VectorType gridpack::math::NewtonRaphsonSolverT< T, I >::VectorType

Constructor & Destructor Documentation

template<typename T , typename I = int>
gridpack::math::NewtonRaphsonSolverT< T, I >::NewtonRaphsonSolverT ( const parallel::Communicator comm,
const int &  local_size,
JacobianBuilder  form_jacobian,
FunctionBuilder  form_function 
)

Default constructor.

Collective.

A NonlinearSolver must be constructed simultaneously on all processes involved in comm.

Parameters:
comm communicator on which the instance is to exist
local_size number Jacobian rows and Vector entries to be owned by this process
form_jacobian function to fill the Jacobian Matrix, $\left[ \mathbf{J}\left( \mathbf{x} \right) \right]$
form_function function to fill the RHS function Vector, $\mathbf{F}\left( \mathbf{x} \right)$
Returns:
new NonlinearSolver instance
template<typename T , typename I = int>
gridpack::math::NewtonRaphsonSolverT< T, I >::NewtonRaphsonSolverT ( MatrixType J,
JacobianBuilder  form_jacobian,
FunctionBuilder  form_function 
)

Construct with an existing Jacobian Matrix.

template<typename T , typename I = int>
gridpack::math::NewtonRaphsonSolverT< T, I >::~NewtonRaphsonSolverT ( void   ) 

Destructor.

This must be called simultaneously by all processes involved in the communicator used for construction.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 3 Feb 2020 for GridPACK by  doxygen 1.6.1